package com.itheima.order.service.impl;

import com.itheima.order.dao.OrderMapper;
import com.itheima.order.pojo.Order;
import com.itheima.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    OrderMapper orderMapper;

    /**
     * 根据用户名查询订单
     *
     * @param username
     * @return
     */
    @Override
    public List<Order> findOrdersByUserName(String username) {
        Order order = new Order();
        order.setUsername(username);
        List<Order> orders = orderMapper.select(order);
        return orders;
    }
}
